package db

import (
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

func (c Config) dialector() gorm.Dialector {
	switch c.Driver {
	case Mysql:
		return mysql.Open(c.DSN)
	default:
		panic("unsupported db driver: " + c.Driver)
	}
}
